package com.alogic.lucene.core;

import org.apache.lucene.analysis.Analyzer;

/**
 * 扩展的Analyzer
 *
 * @version 1.6.13.8 [20200814 duanyy] <br>
 * - 增加分词的扩展信息(domain,tags)的功能 <br>
 */
public abstract class ExtAnalyzer extends Analyzer {
    abstract public void addWord(String word);
    abstract public void disableWord(String word);
    abstract public void addWord(String word,String domain,String tags);
    abstract public WordInfo getWordInfo(String word);

    public class WordInfo {
        protected String domain;
        protected String tags;

        public WordInfo(String domain,String tags){
            this.domain = domain;
            this.tags = tags;
        }

        public String getDomain(){
            return domain;
        }

        public String getTags(){
            return tags;
        }
    }
}
